/**
 * 接口之间的兼容性,类似于class。并且,class和interface直接也可以兼容
 * 
 */

interface Point {
    x:number
    y:number
}

interface Point2 {
    x:number
    y:number
}

interface Point3 {
    x:number
    y:number
    z:number
}
let p1: Point
let p2: Point2 = {x:1,y:2}
let p3: Point3= {x:1,y:2,z:3}

p1 = p2

p1 = p3


//类和接口之间也是兼容的
class Point4 {
    x:number
    y:number
    z:number
}

let p4 = new Point4()

p2 = p4

